#!/usr/bin/env python3
# -*- coding: utf-8
"""
Weaviate配置文件 - 更新版本
包含OpenAI embedding和Weaviate连接配置
"""

# Weaviate连接配置
WEAVIATE_CONFIG = {
    "url": "http://192.168.5.93:8080",  # 云侧Weaviate服务地址 - HTTP端口
    "host": "192.168.5.93",
    "port": 8080,
}

# OpenAI Embedding配置
OPENAI_EMBEDDING_CONFIG = {
    "api_key": "sk-2c6fe27d93354aa2bc9f8204f4ae2222",
    "base_url": "http://116.204.127.251:8605/api/v1",
    "model": "text-embedding-3-large",
    "dimensions": 3072,  # text-embedding-3-large的向量维度
}

# 场景记忆配置
SCENE_MEMORY_CONFIG = {
    "similarity_threshold": 0.8,  # 默认相似度阈值
    "collection_name": "Scene",  # 集合名称
    "max_search_results": 10,  # 最大搜索结果数
}

# 向量化器配置
VECTORIZER_CONFIG = {
    "provider": "openai",  # 可选: "openai", "transformers"
    "model": "text-embedding-3-large",
    "dimensions": 3072,
}

# 环境变量配置
ENVIRONMENT_VARS = {
    "OPENAI_API_KEY": "sk-2c6fe27d93354aa2bc9f8204f4ae2222",
    "OPENAI_BASE_URL": "http://116.204.127.251:8605/api/v1",
}


def get_weaviate_client_config():
    """获取Weaviate客户端配置"""
    return {
        "weaviate_url": WEAVIATE_CONFIG["url"],
        "openai_api_key": OPENAI_EMBEDDING_CONFIG["api_key"],
        "openai_base_url": OPENAI_EMBEDDING_CONFIG["base_url"],
    }


def get_openai_embedding_config():
    """获取OpenAI embedding配置"""
    return OPENAI_EMBEDDING_CONFIG


def get_scene_memory_config():
    """获取场景记忆配置"""
    return SCENE_MEMORY_CONFIG


def get_vectorizer_config():
    """获取向量化器配置"""
    return VECTORIZER_CONFIG
